package com.framework.admin.schedule.feign;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
public class DynamicClient {
    @Autowired
    private DynamicFeignClientFactory<RemoteApi> dynamicFeignClientFactory;

    public Object executePostApi(String feignName, String url, Object params) {
        RemoteApi remoteApi = dynamicFeignClientFactory.getFeignClient(RemoteApi.class, feignName);
        return remoteApi.executePostApi(url, params);
    }

    public Object executeGetApi(String feignName, String url, Object params) {
        RemoteApi remoteApi = dynamicFeignClientFactory.getFeignClient(RemoteApi.class, feignName);
        return remoteApi.executeGetApi(url, params);
    }
}

